<template>
  <div class="Inspectionrecords">
    <div class="Inspectionrecords-item">
      <div class="item-count">
        <div class="num" style="color: #ed9325">
          {{ data.provinceCnt || 0 }}
        </div>
        <span>条</span>
      </div>
      <div class="item-type">省级下发</div>
    </div>
    <div class="Inspectionrecords-item">
      <div class="item-count">
        <div class="num" style="color: #2197ef">
          {{ data.cityCnt || 0 }}
        </div>
        <span>条</span>
      </div>
      <div class="item-type">市级下发</div>
    </div>
    <div class="Inspectionrecords-item">
      <div class="item-count">
        <div class="num" style="color: #ef4e51">
          {{ data.zoneCnt || 0 }}
        </div>
        <span>条</span>
      </div>
      <div class="item-type">区级下发</div>
    </div>
    <div class="Inspectionrecords-item">
      <div class="item-count">
        <div class="num" style="color: #a6e2ee">
          {{ data.streetCnt || 0 }}
        </div>
        <span>条</span>
      </div>
      <div class="item-type">自主走访</div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";

let data = ref({});

const accept = (info) => {
  if (info.check) {
    data.value = info.check;
  } else {
    data.value = {};
  }
};

defineExpose({ accept });
</script>

<style scoped lang="scss">
.Inspectionrecords {
  position: relative;
  width: 100%;
  height: calc(100% - 30px);
  background: url("@/assets/images/record.png") no-repeat;
  background-size: 100% 100%;
  display: flex;
  flex-wrap: wrap;
  .Inspectionrecords-item {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    color: #ffffff;
    padding-right: 50px;
    .item-count {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 90px;
      height: 25px;
      background: url("@/assets/images/title.png") no-repeat;
      background-size: 100% 100%;
      span {
        font-size: 12px;
        margin-left: 2px;
        color: #646b75;
      }
      .num {
        font-weight: bold;
        font-size: 16px;
      }
    }
    .item-type {
      font-size: 12px;
      text-align: center;
      width: 100px;
      padding: 5px 20px;
      background: linear-gradient(
        90deg,
        rgba(7, 71, 112, 0) 0%,
        #074770 50%,
        rgba(7, 71, 112, 0) 100%
      );
    }
  }
  .Inspectionrecords-item:nth-child(2),
  .Inspectionrecords-item:nth-child(4) {
    padding: 0 0 0 50px;
  }
}
</style>
